﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TrainingsRequestsExt>" %>

<% 
    var trainersCol = new CRM.Database.Model.TrainingsTrainersCollection();
    
    Html.DevExpress().ComboBox(settings =>
                {
                    settings.Name = "IdTrainingsTrainer";
                    settings.CallbackRouteValues = new { Controller = "TC", Action = "TrainingsRemoteRequestEditTrainersPartial", key = Model.Key };
                    settings.Properties.ValueType = typeof(int);
                    settings.Properties.TextField = "Name";
                    settings.Width = 120;
                    settings.Properties.EnableCallbackMode = true;
                    settings.Properties.ValueField = "IdTrainingsTrainer";
                    settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['IDCOURSE'] = IdTrainingsCourse.GetValue(); }";
                    settings.Properties.ClientSideEvents.EndCallback = "function(s, e) {IdTrainingsPlace.PerformCallback();}";
                }).BindList(trainersCol.GetTrainersListByCourseId(Model.IdTrainingsCourse)).Bind(Model.IdTrainingsTrainer).GetHtml();
%>

<%--


<%
        var auditoriumsCol = new CRM.Database.Model.TrainingsAuditoriumsCollection();
                
        Html.DevExpress().ComboBox(settings =>
                {
                    settings.Name = "IdTrainingsAuditorium";
                    settings.CallbackRouteValues = new { Controller = "TC", Action = "TrainingsRemoteRequestEditAuditoriumsPartial", key = Model.Key };
                    settings.Properties.ValueType = typeof(int);
                    settings.Properties.TextField = "LocalizedName";
                    settings.Width = 247;
                    settings.Properties.EnableCallbackMode = true;
                    settings.Properties.ValueField = "IdTrainingsAuditorium";
                    settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['IDCOURSE'] = IdTrainingsCourse.GetValue(); }";
                    settings.Properties.ClientSideEvents.EndCallback = "function(s, e) {IdTrainingsTrainer.PerformCallback();}";
                }).BindList(auditoriumsCol.GetAuditoriumsListByCourseId(Model.IdTrainingsCourse)).Bind(Model.IdTrainingsAuditorium).GetHtml();
%>--%>